Closed Bug 1492497 Opened 6 years ago Closed 2 years ago

Being able to disable/re-enable an event listener for a given node

Categories

(DevTools :: Inspector, enhancement, P3)

enhancement

Tracking

(firefox98 fixed)

RESOLVED FIXED
98 Branch
Tracking Status
firefox98 --- fixed

People

(Reporter: pbro, Assigned: nchevobbe)

References

(Blocks 1 open bug)

Details

Attachments

(2 files)

Not sure if this belongs more in the Inspector or in the Debugger panel, but in any case, that's a common need that the WebCompat diagnosis team has sent our way.

Chrome let's you do half of this (just remove), but annoyingly, you have to close/open devtools to get it back.
Tom's built something like this is his debugging add-on:

https://github.com/webcompat/tinker-tester-developer-spy
It can be useful, when debugging a site, to toggle event listeners, especially when there are multiple handlers set on parent nodes, etc.
Severity: normal → enhancement
Priority: -- → P3
Duplicate of bug 1226637? I see one difference in that this one focuses on node events, while bug 1226637 covers all events. I guess the Events panel will also cover all events, right?

Sebastian
Flags: needinfo?(odvarko)
(In reply to Sebastian Zartner [:sebo] from comment #4)
> Duplicate of bug 1226637? I see one difference in that this one focuses on
> node events, while bug 1226637 covers all events. I guess the Events panel
> will also cover all events, right?

Yes, it's duplicate

This bug covers side-panel in the Inspector panel (ie listeners for the selected node/element) as well as the other bug - marked as "[inspector panel]". I'll close bug 1226637 and copy one comment from bgrins that sounds useful.

Thanks!
Honza
Flags: needinfo?(odvarko)
Copying over a relevant comment from bug 1226637 by :bgrins:

====
That would be pretty nice! A few thoughts:

1) I think it'd need some UX work as far as how to show disabled event listeners in the inspector / debugger.
2) There's event listener breakpoint work planned at https://github.com/devtools-html/debugger.html/issues/4750 / https://docs.google.com/document/d/1DXzoa7cUZJ_z41_QK1I1nPtyexkgGxup7C_at1SCcQs/edit. It's not the same usecase but maybe we could re-use some of the UI concepts for listing and managing listeners.
3) Would be interesting if it could be extended to any EventTarget when we allow event inspection in the console.
====

It looks like the Event Breakpoints feature is complete (at least it's present in Dev Edition), but I still cannot disable specific events. Was this shelved?

(In reply to Jan Honza Odvarko [:Honza] (always need-info? me) from comment #3)

This feature is planned as part of "Pause on Event" project.

You might also see:
https://docs.google.com/document/d/
1HPTnwnYydsRBRZw3XqGoiOSaMSIeHBvKRQENm4RegPI/edit?ts=5bce6279#heading=h.
532o8ksi95wv

Honza

Hello,

It seems that features were different: "remove an event listener from devtools" and "pause or breakpoint on events".
The 2nd one is OK, but, like vaindil, I don't see the 1st one.

I don't understand why https://bugzilla.mozilla.org/show_bug.cgi?id=1226637 was marked as duplicate and resolved, for me, it was totally different, even if some code could be reused.

Benjamin

Hello,

I see this issue has been resolved, but not actually implemented.
I would like to be able to toggle events on/off, or in the least disable them like I can on Chrome. This is a core feature when working as a web developer and I sadly must always switch over to Chrome for Event related debugging...

(In reply to dbkup from comment #11)

Hello,

I see this issue has been resolved, but not actually implemented.
I would like to be able to toggle events on/off, or in the least disable them like I can on Chrome. This is a core feature when working as a web developer and I sadly must always switch over to Chrome for Event related debugging...

What I mean is the linked bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1226637 is marked as duplicate and resolved, but doesn't actually fix the issue as described above.

(In reply to dbkup from comment #12)

(In reply to dbkup from comment #11)

Hello,

I see this issue has been resolved, but not actually implemented.
I would like to be able to toggle events on/off, or in the least disable them like I can on Chrome. This is a core feature when working as a web developer and I sadly must always switch over to Chrome for Event related debugging...

What I mean is the linked bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1226637 is marked as duplicate and resolved, but doesn't actually fix the issue as described above.

The resolution of that bug is DUPLICATE. That means that the person who closed it did so not because they think the issue is fixed, but because they don't want to have multiple bugs open that all track the same issue. This keeps discussion of the issue focused in one place and simplifies maintenance.

Would super love this feature back again. Thanks!

Depends on: 1748431
Depends on: 1748631
Assignee: nobody → nchevobbe
Status: NEW → ASSIGNED
Blocks: 1749550
Pushed by nchevobbe@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/5a82b7a2951e
[devtools] Add a way to disable (and re-enable) event listener for a given node. r=ochameau,devtools-backward-compat-reviewers,bomsy.
Flags: needinfo?(nchevobbe)

Fixed the test failure (it was a leak because accessing nsIEventListenerInfo.enabled while the page closes, i guess, was throwing and not clearing the node actor map properly)

Flags: needinfo?(nchevobbe)
Pushed by nchevobbe@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/c4da31624b83
[devtools] Add a way to disable (and re-enable) event listener for a given node. r=ochameau,devtools-backward-compat-reviewers,bomsy.
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 98 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: